import NoAuthView from "@/views/NoAuthView.vue";
import userLayout from "@/layouts/userLayout.vue";
import LoginView from "@/views/user/LoginView.vue";
import RegisterView from "@/views/user/registerView.vue";
import AddQuestionView from "@/views/question/AddQuestionView.vue";
import ManageQuestionView from "@/views/question/ManageQuestionView.vue";
import QuestionsView from "@/views/question/QuestionsView.vue";

export const routes = [
	{
		path: "/questions",
		name: "浏览题目",
		component: QuestionsView
	},
	{
		path: "/add/question",
		name: "创建题目",
		component: AddQuestionView,
		meta: {
			access: "admin"
		}
	},
	{
		path: "/update/question",
		name: "更新题目",
		component: AddQuestionView,
		meta: {
			access: "admin",
			hide: true
		}
	},
	{
		path: "/manage/question",
		name: "管理题目",
		component: ManageQuestionView,
		meta: {
			access: "admin"
		}
	},
	{
		path: "/user",
		name: "user",
		component: userLayout,
		children: [
			{
				path: "/user/login",
				name: "login",
				component: LoginView
			},
			{
				path: "/user/register",
				name: "register",
				component: RegisterView
			}
		]
	},
	{
		path: "/unAuth",
		name: "unAuth",
		component: NoAuthView,
		meta: {
			hide: true
		}
	}
];
